﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class visiteLog : System.Web.UI.Page
{
    TB.BLL.VisitLog logBll = new TB.BLL.VisitLog();
    
    TB.Entity.VisitLog logEntity = new TB.Entity.VisitLog();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if (Session["username"] == null)
            {
                Response.Redirect("~/Account/Login.aspx");
            }
        }
        string username=Request.QueryString["us"].ToString();
        string nickname = Request.QueryString["nick"].ToString();
        ((Label)this.Master.FindControl("lblCurrentUser")).Text = username;
        System.Data.DataSet ds = logBll.GetLogDataSet(username, nickname);
        myGridView.DataSource = ds.Tables[0];
        myGridView.DataBind();

    }
    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
               if (e.Row.RowIndex != -1)
           {
                int indexID = this.myGridView.PageIndex * this.myGridView.PageSize + e.Row.RowIndex + 1;
                 e.Row.Cells[0].Text = indexID.ToString();
            }

    }
}